package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.ElasticityPackAttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import org.springframework.stereotype.Service;

@Service
@AttrHandler(ElasticityPackAttrHandler.class)
public class ElasticityPackAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {
    @Override
    public void handle(KiteAttr kiteAttr, KiteInst inst, AttrData attrData) {
        // 弹性增值包  下拉框有值   对应input框必填
        String values = inst.getAttrValue("210004141");
        KiteAttr attr = inst.getAttr("210004142");
        if(KiteStringUtils.isNotBlank(values)){
            attr.setIsNull(KeyConsts.IFTRUE_F);
        }else{
            attr.setIsNull(KeyConsts.IFTRUE_T);
        }
    }

    @Override
    public void handleStyle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {

    }
}
